<template>
    <div class="app">
        <home></home>
        <h2> App:{{ name }}</h2>
        <button @click="name = '小染'">改变姓名</button>
    </div>
</template>
<script>
import home from "./home.vue"
import { ref, provide } from "vue"
export default {
    components: {
        home
    },
    setup() {
        // ref 传递动态数据
        const name = ref("xiaoran")
        provide("name", name)
        provide("age", 18)

        return {
            name
        }
    }
}
</script>
<style scoped lang="less"></style>